package demo.sicua.votesystem.dao;

import demo.sicua.votesystem.entity.PO.UserPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserDao {

    /**
     * 查询所有用户信息
     * @return UserPO
     */
    List<UserPO> selectUsers();

    UserPO selectUsersByPwdAndUsername(@Param("username") String username,
                                       @Param("password") String password);

    List<UserPO> selectUsersByPaging(@Param("index") int i, @Param("limit") int limit);

    int selectUserCount();

    UserPO selectUserById(@Param("uid") String uid);

    boolean deleteUserById(@Param("uid") String uid);

    boolean insertUser(@Param("userPO") UserPO userPO);

    boolean updateUser(@Param("userPO") UserPO userPO);

    UserPO selectUserByName(@Param("username") String username);
}
